<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>    
<%@ page import="java.util.List" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sunyu Bus Booking System - Selecting Schedule</title>
</head>
<body>
<%
	String msg = (String)request.getAttribute("msg");
	if (msg != null && msg != "") {
		out.print("<font color='red'>" + msg + "</font> <br>");
	}
%>

<form action="BookingBusProc.do">
	<%
		out.print("<input type='hidden' name='bus_id' value='" + request.getAttribute("bus_schedule") + "'>");
	%>
	
	Date <select name="bus_date_year">
	<%
		for (int i = 2014; i < 2050; ++i) {
			out.print("<option value='" + i +"'>" + i + "</option>");
		}
	%>
	</select> 
	<select name="bus_date_month">
	<%
		for (int i = 1; i < 13; ++i) {
			out.print("<option value='" + i +"'>" + i + "</option>");
		}
	%>
	</select>
	<select name="bus_date_day">
	<%
		for (int i = 1; i < 31; ++i) {
			out.print("<option value='" + i +"'>" + i + "</option>");
		}
	%>
	</select> <br>
	Time <select name="bus_time">
	<%
		List lstBusSchedule = (List)request.getAttribute("bus_schedule");
		for (int i = 0; i < lstBusSchedule.size(); ++i) {
			String time = (String)lstBusSchedule.get(i);
			
			out.print("<option value='" + time +"'>" + time + "</option>");
		}
	%>
	</select> <br>
	<input type="submit" value="Booking"> <br>	
</form>
</body>
</html>